<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<s:url var="regionsUrl" action="getRegions" namespace="/"/>
<s:url var="countryCodeUrl" action="getCountryCode" namespace="/"/>
<s:select label="Country" name="countries.country" id="country"
          list="countries"
          listKey="countryId"
          listValue="country"
          value="countrySelected.countryId"
          onchange="getRegions(this.value, $('#country option:selected').text(), '%{regionsUrl}');fillCountryCode(this.value, '%{countryCodeUrl}');">
</s:select>

<s:url var="citiesUrl" action="getCities" namespace="/"/>
<s:select label="Region" name="regions.region" id="regions"
          list="regions"
          listKey="regionId"
          listValue="region"
          value="regionSelected.regionId"
          onchange="getCities(this.value,  $('#regions option:selected').text(), '%{citiesUrl}');baShowHide()"/>

<s:select label="City" name="cities.city" id="cities"
          list="cities"
          listKey="cityId"
          listValue="city"
          value="citySelected.cityId"
          onchange="isOtherCity(this.value,  $('#cities option:selected').text())"/>

<s:textfield label="Other" id="otherCity"></s:textfield>

<script type="text/javascript">
    $("#otherCity").parent().parent().hide();
</script>